import React from "react";
import ReactDOM from "react-dom/client";
import App from "./react/App";
import { sum } from "./ts/math";

// 1.ES6中const定义常量
const message = "hello babel";
console.log(message);

// 2.ES6中箭头函数
const foo = () => {
  console.log("foo function executed");
};

foo();

// 3.对象的结构
const obj = {
  name: "obj-name",
  age: 18,
};
const { name, age } = obj;
console.log(name, age);

// 4.使用字符串中includes方法
const nickname = "fooName";
// String.prototype.includes => String相关的polyfill就会被打包
console.log(nickname.includes("foo-coder"));
// 5.编写react代码
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<App />);

// 6.使用typescript代码
console.log(sum(20, 30));
console.log(sum(10, 20));
